//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package org.pentaho.kettle.plugin.mqtt.ui.steps.consumer;

import org.pentaho.kettle.plugin.mqtt.steps.consumer.ConsumerStepMeta;
import org.pentaho.ui.xul.XulEventSourceAdapter;

public class ConsumerStepMetaMapper extends XulEventSourceAdapter {
    public static String OUTPUT_NAME = "output_name";
    public static String SUB_BROKER = "sub_broker";
    public static String SUB_TOPIC = "sub_topic";
    public static String CLIENT_ID = "client_id";
    public static String USERNAME = "username";
    public static String PASSWORD = "password";
    public static String QOS = "qos";
    private String username = "";
    private String password = "";
    private String output = "dummy";
    private String sBroker = "tcp://127.0.0.1:1883";
    private String sTopic = "iotdevices";
    private String clientI = "clientID";
    private int qos = 1;

    public ConsumerStepMetaMapper() {
    }

    public void setOutput(String arg) {
        String previousVal = this.output;
        this.output = arg;
        this.firePropertyChange(OUTPUT_NAME, previousVal, this.output);
    }

    public void setsBroker(String arg) {
        String previousVal = this.sBroker;
        this.sBroker = arg;
        this.firePropertyChange(SUB_BROKER, previousVal, this.sBroker);
    }

    public void setSTopic(String arg) {
        String previousVal = this.sTopic;
        this.sTopic = arg;
        this.firePropertyChange(SUB_TOPIC, previousVal, this.sTopic);
    }

    public void setClientId(String arg) {
        String previousVal = this.clientI;
        this.clientI = arg;
        this.firePropertyChange(CLIENT_ID, previousVal, this.clientI);
    }

    public void setQos(int qos) {
        this.qos = qos;
        this.firePropertyChange(QOS, qos, qos);
    }

    public void setUsername(String username) {
        this.username = username;
        this.firePropertyChange(USERNAME, username, username);
    }

    public void setPassword(String password) {
        this.password = password;
        this.firePropertyChange(PASSWORD, password, password);
    }

    public String getOutput() {
        return this.output;
    }

    public String getsBroker() {
        return this.sBroker;
    }

    public String getsTopic() {
        return this.sTopic;
    }

    public String getClientId() {
        return this.clientI;
    }

    public int getQos() {
        return this.qos;
    }

    public String getUsername() {
        return this.username;
    }

    public String getPassword() {
        return this.password;
    }

    public void loadMeta(ConsumerStepMeta meta) {
        this.setOutput(meta.getOutputField());
        this.setsBroker(meta.getSubBroker());
        this.setClientId(meta.getClientId());
        this.setQos(meta.getQos());
        this.setSTopic(meta.getSubTopic());
        this.setUsername(meta.getUsername());
        this.setPassword(meta.getPassword());
    }

    public void saveMeta(ConsumerStepMeta meta) {
        meta.setOutputField(this.getOutput());
        meta.setSubBroker(this.getsBroker());
        meta.setClientId(this.getClientId());
        meta.setQos(this.getQos());
        meta.setSubTopic(this.getsTopic());
        meta.setChanged();
        meta.setUsername(this.getUsername());
        meta.setPassword(this.getPassword());
    }
}
